" ------- maps --------
set timeoutlen=500 
let mapleader = " " 
inoremap jj <C-[>
nnoremap U <C-r>
nnoremap 00 $
nnoremap <leader>0 :set wrap!<CR>
inoremap <C-h> <left>
inoremap <C-j> <down>
inoremap <C-k> <up>
inoremap <C-l> <right>
nnoremap j gj
nnoremap k gk
vnoremap j gj
vnoremap k gk
vnoremap H 0
vnoremap L $
vnoremap J G
vnoremap K gg
nnoremap H 0
nnoremap L $
nnoremap J G
nnoremap K gg
nnoremap <tab> :
nnoremap \ /
nnoremap <silent> <BS> :nohls<CR>
vnoremap <Space><Space> <C-[>
" inoremap ( ()<C-[>i
" inoremap [ []<C-[>i
" inoremap { {}<C-[>i
" inoremap ' ''<C-[>i
" inoremap " ""<C-[>i
" inoremap < <><C-[>i
vnoremap <C-j> :m '>+1<CR>gv=gv
vnoremap <C-j> :m '>+1<CR>gv=gv
xnoremap <C-k> :m '<-2<CR>gv=gv
xnoremap <C-k> :m '<-2<CR>gv=gv
nnoremap Y yiw
nnoremap D diw
nnoremap C ciw
inoremap <leader><CR> <C-[>o
inoremap <leader><leader><CR> <C-[>O
nnoremap <left> <Nop>
nnoremap <right> <Nop>
nnoremap <up> <Nop>
nnoremap <down> <Nop>
vnoremap <left> <Nop>
vnoremap <right> <Nop>
vnoremap <up> <Nop>
vnoremap <down> <Nop>
inoremap <left> <Nop>
inoremap <right> <Nop>
inoremap <up> <Nop>
inoremap <down> <Nop>


nnoremap <F10> :TagbarToggle<CR>

nnoremap <C-left> :vertical resize -2<CR>
nnoremap <C-right> :vertical resize +2<CR>
nnoremap <C-down> :resize +2<CR>
nnoremap <C-up> :resize -2<CR>

nnoremap <leader>wc :close<CR>
nnoremap <leader>wo :only<CR>
nnoremap <leader>ws :vs<CR>
nnoremap <leader>wS :sv<CR>
nnoremap <leader>wn <C-w>n
nnoremap <leader>wd <C-w>=
nnoremap <leader>wh <C-w>H
nnoremap <leader>wj <C-w>J
nnoremap <leader>wk <C-w>K
nnoremap <leader>wl <C-w>L
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l

imap \\ <C-[>/<++><CR>:nohlsearch<CR>c4l

nnoremap <leader>e :NERDTreeToggle<CR>

" This is maps setup of the Markdown ===
autocmd Filetype markdown inoremap --- <Enter>---<Enter><br/><Enter>
autocmd Filetype markdown inoremap BB **** <++><Esc>F*hi
autocmd Filetype markdown inoremap DD ****** <++><Esc>F*hhi
autocmd Filetype markdown inoremap II ** <++><Esc>F*i
autocmd Filetype markdown inoremap SS ~~~~ <++><Esc>F~hi
autocmd Filetype markdown inoremap UU <u></u> <++><Esc>2F<i
autocmd Filetype markdown inoremap LS <details><Enter><summary></summary><Enter><++><Enter></details><Esc>2k0f>a
autocmd Filetype markdown inoremap ` `` <++><Esc>F`i
autocmd Filetype markdown inoremap ``` `````` <++><Esc>3F`i
autocmd Filetype markdown inoremap <leader>` ```<Enter>```<Enter><++><Esc>2kA
autocmd Filetype markdown inoremap ~~ ~~~<Enter><Enter>~~~<Enter><++><Esc>2kA
autocmd Filetype markdown inoremap <leader>pp ![](<++>) <++><Esc>F[a
autocmd Filetype markdown inoremap <leader>aa [](<++>) <++><Esc>F[a
autocmd Filetype markdown inoremap !! #<Space>
autocmd Filetype markdown inoremap @@ ##<Space>
autocmd Filetype markdown inoremap ## ###<Space>
autocmd Filetype markdown inoremap $$ ####<Space>
